package com.jwsoft.manager.core.gateway.controller;

import com.jwsoft.manager.core.integration.EduStudentEnrollReviewIntegration;
import com.jwsoft.manager.common.vo.eduStudentEnrollReview.EduStudentEnrollReviewVO;
import com.jwsoft.manager.common.vo.eduStudentEnrollReview.EduStudentEnrollReviewKeyVO;
import com.jwsoft.manager.common.vo.eduStudentEnrollReview.EduStudentEnrollReviewQueryVO;
import com.github.pagehelper.PageInfo;
import com.bifang.engine.assistant.core.domain.AppResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import com.bifang.engine.protect.core.annotation.Idempotent;
import org.springframework.validation.annotation.Validated;
import com.bifang.assistant.common.constants.Validators;

/**
 * 报名复审表网关
 *
 * @author zjl
 * @since 2024-04-13
 */
@RestController
@RequestMapping(value = "/doc/api")
@Tag(name = "报名复审表", description = "报名复审表")
public class EduStudentEnrollReviewController {

    @Autowired
    public EduStudentEnrollReviewIntegration eduStudentEnrollReviewIntegration;

    @Operation(summary = "报名复审表分页查询",description = "报名复审表分页查询")
    @PostMapping(value = "/eduStudentEnrollReview0001", produces = "application/json;charset=UTF-8")
    public AppResponse<PageInfo<EduStudentEnrollReviewVO>> getList(@RequestBody @Validated EduStudentEnrollReviewQueryVO vo) {
        return AppResponse.successData(eduStudentEnrollReviewIntegration.getList(vo));
    }

    @Operation(summary = "报名复审表根据主键查询详情",description = "报名复审表根据主键查询详情")
    @PostMapping(value = "/eduStudentEnrollReview0002", produces = "application/json;charset=UTF-8")
    public AppResponse<EduStudentEnrollReviewVO> getById(@RequestBody @Validated EduStudentEnrollReviewKeyVO vo) {
        return AppResponse.successData(eduStudentEnrollReviewIntegration.getById(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "报名复审表新增",description = "报名复审表新增")
    @PostMapping(value = "/eduStudentEnrollReview0004", produces = "application/json;charset=UTF-8")
    public AppResponse<EduStudentEnrollReviewVO> add(@RequestBody @Validated(value = {Validators.Add.class}) EduStudentEnrollReviewVO vo) {
        return AppResponse.successData(eduStudentEnrollReviewIntegration.add(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "报名复审表修改",description = "报名复审表修改")
    @PostMapping(value = "/eduStudentEnrollReview0005", produces = "application/json;charset=UTF-8")
    public AppResponse<EduStudentEnrollReviewVO> edit(@RequestBody @Validated(value = {Validators.Edit.class}) EduStudentEnrollReviewVO vo) {
        return AppResponse.successData(eduStudentEnrollReviewIntegration.edit(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "报名复审表删除",description = "报名复审表删除")
    @PostMapping(value = "/eduStudentEnrollReview0006", produces = "application/json;charset=UTF-8")
    public AppResponse del(@RequestBody @Validated EduStudentEnrollReviewKeyVO vo) {
        eduStudentEnrollReviewIntegration.del(vo);
        return AppResponse.successMsg("删除成功！");
    }
}
